﻿using System;
using UnitDriven;

#if MSTEST
using Microsoft.VisualStudio.TestTools.UnitTesting;
#elif NUNIT
using NUnit.Framework;
using TestClass = NUnit.Framework.TestFixtureAttribute;
using TestMethod = NUnit.Framework.TestAttribute;
#endif

namespace Silverlight
{
	[TestClass]
	public class TestCases
	{
		[TestCase(1)]
		public void TestCaseWithSingleArg(int x)
		{
		}

		[TestCase(1, 2)]
		public void TestCaseWithTwoArgs(int x, int y)
		{
		}

		[TestCase(1, 2, 3)]
		public void TestCaseWithThreeArgs(int x, int y, int z)
		{
		}

		[TestCase(1, 2, 3, 4)]
		public void TestCaseWithNArgs(int w, int x, int y, int z)
		{
		}

		[TestCase(1)]
		[TestCase(2)]
		public void MultipleTestCases(int x)
		{
		}

		[TestCase(1, 2, Result = 3)]
		public int ReturningTestCase(int x, int y)
		{
			return x + y;
		}

		[TestCase("expected", ExpectedException = typeof(Exception), ExpectedMessage = "expected", MatchType = MessageMatch.Exact)]
		[TestCase("abc expected xyz", ExpectedException = typeof(Exception), ExpectedMessage = "expected", MatchType = MessageMatch.Contains)]
		[TestCase("expected xyz", ExpectedException = typeof(Exception), ExpectedMessage = "expected", MatchType = MessageMatch.StartsWith)]
		public void ThrowingTestCase(string message)
		{
			throw new Exception(message);
		}
	}
}
